<?php

/**
 * ItemDestaque form base class.
 *
 * @package    form
 * @subpackage item_destaque
 * @version    SVN: $Id: sfDoctrineFormGeneratedTemplate.php 8508 2008-04-17 17:39:15Z fabien $
 */
class BaseItemDestaqueForm extends BaseFormDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'id_item_destaque' => new sfWidgetFormInputHidden(),
      'nu_posicao'       => new sfWidgetFormInput(),
      'st_item_destaque' => new sfWidgetFormInput(),
      'id_item_sistema'  => new sfWidgetFormDoctrineChoice(array('model' => 'ItemSistema', 'add_empty' => true)),
      'created_at'       => new sfWidgetFormDateTime(),
      'updated_at'       => new sfWidgetFormDateTime(),
      'deleted'          => new sfWidgetFormInputCheckbox(),
    ));

    $this->setValidators(array(
      'id_item_destaque' => new sfValidatorDoctrineChoice(array('model' => 'ItemDestaque', 'column' => 'id_item_destaque', 'required' => false)),
      'nu_posicao'       => new sfValidatorInteger(),
      'st_item_destaque' => new sfValidatorString(array('max_length' => 1)),
      'id_item_sistema'  => new sfValidatorDoctrineChoice(array('model' => 'ItemSistema', 'required' => false)),
      'created_at'       => new sfValidatorDateTime(array('required' => false)),
      'updated_at'       => new sfValidatorDateTime(array('required' => false)),
      'deleted'          => new sfValidatorBoolean(),
    ));

    $this->widgetSchema->setNameFormat('item_destaque[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'ItemDestaque';
  }

}
